package org.oslims.client.uicomponents.editbox;

import org.oslims.domain.LabManager;

public class EditLabManagerBox extends EditUserBox {

	private LabManager labManager;

	public EditLabManagerBox() {
		// Call super to generate the default fields for a user
		super();

		// Add the save and cancel buttons
		editUserBoxPanel.add(buttonLine);
	}

	@Override
	protected void clear() {
		super.clear();
	}

	public void showNew() {
		this.clear();
		this.clearAllErrors();
		this.labManager = null;
		editUserBox.setText("Create new Lab Manager");
		editUserBox.center();
	}

	public void showEdit(LabManager labManager) {
		this.clear();
		this.clearAllErrors();
		editUserBox.setText("Edit Lab Manager");
		super.showEdit(labManager);

		this.labManager = labManager;
		editUserBox.center();
	}

	public void showError(String fieldName, String message) {
		super.showError(fieldName, message);
	}

	public void clearError(String fieldName) {
		super.clearError(fieldName);
	}

	public void clearAllErrors() {
		super.clearAllErrors();
	}

	public void setLabManager(LabManager labManager) {
		this.labManager = labManager;
	}

	public LabManager getLabManager() {
		return labManager;
	}
}
